home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13412 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: castle.nando.net!news
  2. From: actuary@nando.net@mailhost.nando.net (Bill McCarthy)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: File problem with Watcom C/C++ 10.5
  5. Date: Sun, 07 Apr 1996 19:37:07 -0400
  6. Organization: Nando.net Public Access
  7. Distribution: world
  8. Message-ID: <jGFaxUKSAOTS089yn@mailhost.nando.net>
  9. References: <4k9fds$4fs@sparcserver.lrz-muenchen.de>
  10. NNTP-Posting-Host: grail613.nando.net
  11.  
  12. In article <4k9fds$4fs@sparcserver.lrz-muenchen.de>,
  13. Ralph Reichart <reichart@informatik.tu-muenchen.de> wrote:
  14. >hi,
  15. >
  16. >i have a big problem. i'm trying to open a file with fopen. the program 
  17. >looks like this:
  18. >
  19. >#include <stdlib.h>
  20. >#include <stdio.h>
  21. >
  22. >main()
  23. >{
  24. > FILE *Datei;
  25. >
  26. > Datei = fopen("\autoexec.bat", "r");
  27. > if (Datei == NULL)
  28. > {
  29. >  printf("\nSHIT!!");
  30. >  exit(1);
  31. > };
  32. > fclose(Datei);
  33. >}
  34. >
  35. >i'm sorry, but i can't open it. i always have the value -1 or 1 in errno.
  36. >yes, the file exists, but it doesn't matter. it never works.
  37. >can somebody please help me??
  38.  
  39. Here's a big hint, ralphy:  Ding Dong
  40.  
  41. Your found the bell ('\a').  If you insist on using backslash
  42. characters, use two.  Or use a single foreward slash.
  43.  
  44. Bill McCarthy
  45. actuary@nando.net
  46. Wendell, NC  USA
  47.